#ifndef BASESUBWINDOW_H
#define BASESUBWINDOW_H

#include <windows.h>

class baseSubWindow
{
protected:
	typedef struct shape
	{
		int m_x, m_y, m_cx, m_cy;
		int set(int x, int y, int cx, int cy)
		{
			m_x = x;
			m_y = y;
			m_cx = cx;
			m_cy = cy;
			return 0;
		}
	};
public:
	baseSubWindow();
	virtual ~baseSubWindow();
	HWND getHwnd();
	HWND getContainer();
	unsigned int getMenu();

	virtual int OnButtonClick();
	virtual int OnPaint();
	virtual HWND Create(TCHAR tsname[], HWND hwnd) = 0;
	virtual int getShape(shape* sp) = 0;
protected:
	HWND m_hwnd;
	HWND m_hWndContainer;
	unsigned int m_uiMenu;
};


#define SETSHAPE(classname, x, y, cx, cy) \
	int \
	classname::getShape(shape *sp) \
	{ \
		sp->set(x, y, cx, cy); \
		return 0; \
	}
#endif